#pragma once
#include "MyGameWindow.h"
#include "MyGameCusor.h"
#include "MyGameTip.h"
#include "vector"
using namespace std;

class CMyGameWindowMgr
{
protected:
	vector<CMyGameWindow*> m_vShowGameWindows;
	vector<CMyGameWindow*> m_vHideGameWindows;
	CMyGameWindow* m_pWndCurMouseDown;
	CMyGameCusor m_GameCursor;
	CMyGameTip m_GameTip;
	UINT m_nMouseXDistance;
	UINT m_nMouseYDistance;
	void SortAllGameWindow();

public:
	CMyGameWindowMgr(void);
	~CMyGameWindowMgr(void);

	void AddGameWindow(CMyGameWindow* pGameWindow);
	void DelGameWindow(CMyGameWindow* pGameWindow);
	CMyGameWindow* FindGameWindow(string strParentName,string ChildName);
	CMyGameWindow* FindGameWindow(string strName,UINT& nCount);

	void DestoryAllGameWindow();
	void DestoryGameWindow(CMyGameWindow* pGameWindow);

	UINT GetWindowCout();

	void CallWindowMsg(string strDstWindowName,string strSrcWndName,string strMsgName,void* pData);

	void OnMouseMove(int x,int y);
	void OnLMouseBtnDown(int x,int y);
	void OnLMouseBtnUp(int x,int y);
	void OnRMouseBtnDown(int x,int y);
	void OnRMouseBtnUp(int x,int y);
	void OnKeyUp(WPARAM wParam);
	void OnChar(WPARAM wParam,LPARAM lParam);

	void UpDateAllGameWindow();
	void DrawAllWindow(HDC hDC);
	void DrawMouse(HDC hDC);
};
